home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)aae.d64
/
euchre 1
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
9KB
|
396 lines
10 REM **
20 REM ** EUCHRE:
30 REM ** PROGRAMMED BY HERB HASLER
40 REM **
100 PRINT"[147]":B$=" ":POKE53281,15
110 POKE 53280,15
120 FORI=1TO3:READIU(I):NEXT:D1=25:D2=15
130 DATA1,0,1
140 FORI=1TO8:READCD$(I):NEXT
150 FORI=1TO4:READST$(I):NEXT
160 FORI=1TO4:READTP$(I):NEXT
170 DEF FNR(X)=INT(RND(0)*X)
180 CL$(4)="[144]"
190 CL$(1)="[144]"
200 CL$(0)="[144]"
210 CL$(2)=""
220 CL$(3)=""
230 GOSUB1970
240 DECK$="000000000000000000000000":C=0:MD=0
250 DD=DD+1:IFDD=3THENDD=1
260 FORJ=1TO5:C$(J)="[166][166][166][166][166]":NEXT
270 FORI=1TO29STEP7
280 CR=FNR(6)+1:TS=FNR(4)+1:MC(I/7+1)=CR:MS(I/7+1)=TS
290 IFMID$(DECK$,CR+(TS-1)*6,1)="1"THEN280
300 DECK$=LEFT$(DECK$,CR-1+(TS-1)*6)+"1"+RIGHT$(DECK$,24-CR-(TS-1)*6)
310 PRINT""
320 GOSUB670
330 FORDL=1TO99:NEXT
340 NEXT
350 FORI=1TO29STEP7
360 CR=FNR(6)+1:TS=FNR(4)+1
370 C$(1)=CD$(CR)+" "
380 C$(2)=ST$(TS)+" "
390 C$(3)=" "
400 C$(4)=" "+ST$(TS)
410 C$(5)=" "+CD$(CR)
420 IFMID$(DECK$,CR+(TS-1)*6,1)="1"THEN360
430 PRINT"";
440 DECK$=LEFT$(DECK$,CR-1+(TS-1)*6)+"1"+RIGHT$(DECK$,24-CR-(TS-1)*6)
450 X1=TS:GOSUB670
460 FORDL=1TO99:NEXT
470 PC(I/7+1)=CR:PS(I/7+1)=TS
480 NEXT
490 PRINT""
500 CR=FNR(6)+1:TS=FNR(4)+1:XX=TS:XC=CR
510 C$(1)=CD$(CR)+" "
520 C$(2)=ST$(TS)+" "
530 C$(3)=" "
540 C$(4)=" "+ST$(TS)
550 C$(5)=" "+CD$(CR)
560 IFMID$(DECK$,CR+(TS-1)*6,1)="1"THEN500
570 DECK$=LEFT$(DECK$,CR-1+(TS-1)*6)+"1"+RIGHT$(DECK$,24-CR-(TS-1)*6)
580 PRINT"":I=9:X1=XX:GOSUB670
590 PRINT"[144] ";NM$"-";YY;"[144] SID-";MM
600 ONDDGOSUB930,1690
610 IFHI=1THEN1470
620 GOSUB850:IFJ=1THENPRINT"[147]":J=0:GOTO240
630 PRINT""CL$(TM);ST$(TM)
640 GOTO2860
650 DATA9,T,J,Q,K,A,L,R,"[193]","[211]","[218]","[216]"
660 DATA SPADES,HEARTS,DIAMONDS,CLUBS
670 :
680 PRINTTAB(I)"[213][192][192][192][192][192][201]"
690 FORDL=1TO10:NEXT
700 PRINTTAB(I)"[221]"CL$(X1);C$(1)"[221]"
710 FORDL=1TO10:NEXT
720 PRINTTAB(I)"[221]"CL$(X1);C$(2)"[221]"
730 FORDL=1TO10:NEXT
740 PRINTTAB(I)"[221]"CL$(X1);C$(3)"[221]"
750 FORDL=1TO10:NEXT
760 PRINTTAB(I)"[221]"CL$(X1);C$(4)"[221]"
770 FORDL=1TO10:NEXT
780 PRINTTAB(I)"[221]"CL$(X1);C$(5)"[221]"
790 FORDL=1TO10:NEXT
800 PRINTTAB(I)"[202][192][192][192][192][192][203]"
810 FORDL=1TO25:NEXT
820 IFC$(1)="[166][166][166][166][166]"THEN840
830 C=C+1:IFC<6THENPRINTTAB(I+4);C"[145]"
840 RETURN
850 B=ABS(4-TM)+1
860 FORI=1TO5
870 IFMS(I)=TMANDMC(I)=3THENMC(I)=8
880 IFPS(I)=TMANDPC(I)=3THENPC(I)=8
890 IFMS(I)=BANDMC(I)=3THENMC(I)=7:MS(I)=TM
900 IFPS(I)=BANDPC(I)=3THENPC(I)=7:PS(I)=TM
910 NEXT
920 RETURN
930 PRINT""
940 RR=0
950 GOSUB2620
960 IFRR=1THENTR=1:MD=0:TM=XX:GOTO1030
970 PRINT" F1=UP"
980 PRINT" F3=DOWN"
990 GETG$:IFG$=""THEN 990
1000 IFG$="[133]"THENTM=XX:TR=2:MD=1:GOTO1030
1010 IFG$="[134]"THEN1260
1020 GOTO990
1030 PRINT"[145][145][145] CARD "
1040 PRINT" DOWN ?"
1050 GETG$:IFG$=""THEN 1050
1060 PL=VAL(G$)
1070 IFPL>0ANDPL<6THEN 1090
1080 GOTO1050
1090 PRINT""
1100 FORI=1TO7
1110 PRINTTAB((PL-1)*7+1)" "
1120 FORDL=1TO25:NEXT
1130 NEXT
1140 PRINT""
1150 FORI=1TO7
1160 PRINTTAB(9)" "
1170 FORDL=1TO25:NEXT
1180 NEXT
1190 PC(PL)=XC:PS(PL)=XX
1200 PRINT""
1210 I=(PL-1)*7+1
1220 CR=XC:TS=XX
1230 X1=TS:GOSUB670
1240 GOSUB2790
1250 RETURN
1260 FORI=1TO4:VV(I)=0:S(I)=I:NEXT:TM=0:MX=0:GN=0
1270 FORI=1TO5
1280 MX=MC(I)
1290 IFMC(I)=3THENMX=8
1300 VV(MS(I))=VV(MS(I))+MX
1310 IFGN=0THENGOSUB1550
1320 NEXT
1330 FORI=1TO3
1340 Y=0
1350 IF(VV(I))>(VV(I+1))THENV=VV(I):VV(I)=VV(I+1):VV(I+1)=V:Y=1:S=S(I):S(I)=S(I+1)
1360 IFY=1THENS(I+1)=S
1370 IFY=1THEN1330
1380 NEXT
1390 FORI=1TO5:IFMC(I)=6ANDMS(I)<>S(4)THENVV(4)=VV(4)+3
1400 IFMC(I)=5ANDMS(I)<>S(4)THENVV(4)=VV(4)+1
1410 NEXT
1420 IFVV(4)>13THENTM=S(4)
1430 IFTM=XXTHENTM=0
1440 IFTM=0THEN1460
1450 GOSUB2790:TR=1:MD=0:RETURN
1460 HI=0
1470 PRINT"":PRINTB$
1480 PRINT" I PASS, YOU MAKE IT":PRINTB$
1490 PRINT"F1 = SPADES F3 = HEARTS"
1500 PRINT"F5 = DIAMONDS F7 = CLUBS"
1510 PRINTB$
1520 PRINTB$
1530 GOSUB1600
1540 GOTO620
1550 B=ABS(4-MS(I))+1
1560 FORJ=1TO5
1570 IF(MS(J)=B)AND(MC(J)=3)THENMX=MX+7:GN=1
1580 NEXT
1590 RETURN
1600 GETG$:IFG$=""THEN 1600
1610 IFG$="[133]"THENTM=1:GOTO1660
1620 IFG$="[134]"THENTM=2:GOTO1660
1630 IFG$="[135]"THENTM=3:GOTO1660
1640 IFG$="[136]"THENTM=4:GOTO1660
1650 GOTO1600
1660 IFHI=1ANDTM=XXTHEN1600
1670 HI=0:TR=2:MD=1:GOSUB2790
1680 RETURN
1690 PRINT"":HI=0
1700 PRINT" F1=ORDER"
1710 PRINT" F3=PASS"
1720 GETG$:IFG$=""THEN 1720
1730 IFG$="[133]"THENTM=XX:TR=2:MD=1:GOTO1890
1740 IFG$="[134]"THEN1760
1750 GOTO1720
1760 LC=XC
1770 IFXC=3THENXC=8
1780 B=ABS(4-XX)+1
1790 FORI=1TO5
1800 IFMS(I)=XXANDMC(I)=3THENXC=XC+8:GOTO1830
1810 IFMS(I)=XXTHENXC=XC+MC(I)
1820 IFMS(I)=BANDMC(I)=3THENXC=XC+7
1830 NEXT
1840 FORI=1TO5:IFMC(I)=6ANDMS(I)<>XXTHENXC=XC+3
1850 IFMC(I)=5ANDMS(I)<>XXTHENXC=XC+1
1860 NEXT
1870 IFXC>13THENTR=1:MD=0:TM=XX:XC=LC:GOTO1890
1880 GOTO1950
1890 CA=7
1900 FORI=1TO5:IFMC(I)<XCANDMS(I)<>XXTHENCA=MC(I):CT=I
1910 NEXTI
1920 IFCA=7THENCT=1
1930 MC(CT)=XC:MS(CT)=TS
1940 GOSUB2790:GOTO1960
1950 HI=1:RETURN
1960 RETURN
1970 :
1980 GOSUB2210
1990 PRINT"PLEASE ENTER YOUR NAME"
2000 PRINT"(UP TO 10 LETTERS)"
2010 INPUTNM$
2020 IFLEN(NM$)>10THENNM$=" APPONENT"
2030 IFNM$=""THENNM$=" SID"
2040 PRINT"[147]THANK YOU ";NM$
2050 PRINT" HIT RETURN WHEN YOU ARE READY TO BEGIN"
2060 GETG$:IFG$=""THEN 2060
2070 IFASC(G$)=13THENPRINT"[147]":RETURN
2080 GOTO2060
2090 PRINT""
2100 FORI=1TO7:PRINTTAB((CT-1)*7+1)" "
2110 NEXT
2120 C$(1)=CD$(MC(CT))+" "
2130 C$(2)=ST$(MS(CT))+" "
2140 C$(3)=" "
2150 C$(4)=" "+ST$(MS(CT))
2160 C$(5)=" "+CD$(MC(CT))
2170 PRINT""
2180 FORI=1TO7:PRINTB$:NEXT:I=7
2190 PRINT"":X1=MS(CT):GOSUB670
2200 RETURN
2210 PRINT"[147]"
2220 PRINT" [213][192][192][192][192][201][213][192][201] [213][192][201][213][192][192][192][192][201][213][192][201] [213][192][201][213][192][192][192][192][201][213][192][192][192][192][201]"
2230 PRINT" [221] [221][221] [221] [221] [221][221] [221][221] [221] [221] [221][221] [221][221] [221]
2240 [153]" (null) (null)TANTAN(null)(null) (null) (null) (null)(null) (null)TANTAN(null)(null) (null) (null) (null)(null) (null)RIGHT$ (null)(null) (null)TANTAN(null)
2250 PRINT" [221] [221] [221] [221] [221] [221][221] [221] [160][221] [221] [221] [221][221] [202][203] [221][221] [221]
2260 [153]" (null) MID$TANRIGHT$ (null) (null) (null) (null)(null) (null) (null) MID$TAN(null) (null)(null) (null)(null)(null) MID$TANRIGHT$
2270 PRINT" [221] [221] [221] [221] [221] [221][221] [221] [221] [221][221] [213][201][202][201][221] [221]
2280 [153]" (null) (null)TAN(null) (null) (null) (null) (null)(null) (null) (null) (null)TANRIGHT$ (null)(null) (null)(null) (null)(null) (null)TAN(null)
2290 PRINT" [221] [221] [221] [221] [221] [221][221] [221] [221] [221] [221] [221][221] [221][221] [221][221] [221]
2300 [153]" (null) MID$TANTANRIGHT$(null) MID$TAN(null) (null)(null) MID$TANTANRIGHT$(null) (null) (null) (null)(null) (null)(null) (null)(null) MID$TANTANRIGHT$
2310 PRINT" [221] [221][221] [221][221] [221][221] [221] [221] [221][221] [221][221] [221][221] [221]
2320 [153]" MID$TANTANTANTAN(null)MID$TANTANTANTANTAN(null)MID$TANTANTANTAN(null)MID$TAN(null) MID$TAN(null)MID$TAN(null)MID$TAN(null)MID$TANTANTANTAN(null)
2330 PRINT" PROGRAMMED BY H. HASLER"
2340 FORI=54272TO54292:POKEI,0:NEXT
2350 POKE54296,3
2360 POKE54277,1:POKE54284,1:POKE54291,1
2370 POKE54278,255:POKE54285,255:POKE54290,255
2380 POKE54273,4:POKE54272,48
2390 POKE54280,4:POKE54279,48+5
2400 POKE54287,4:POKE54286,48+10
2410 POKE54276,33:POKE54283,33:POKE54290,33
2420 FORDL=1TO1000:NEXT
2430 POKE54276,32:POKE54283,32:POKE54290,32
2440 :
2450 PRINT"DO YOU WISH TO SEE"
2460 PRINT"INSTUCTIONS...(Y/N)"
2470 GETG$:IFG$=""THEN 2470
2480 IFG$="N"THENRETURN
2490 IFG$="Y"THEN2510
2500 GOTO2470
2510 :
2520 PRINT"[147]"
2530 PRINT" THIS GAME IS PLAYED JUST LIKE"
2540 PRINT"ORDINARY EUCHRE, WITH A FEW MINOR"
2550 PRINT"CHANGES..."
2560 PRINT"1) THE PERSON WHO DOES NOT DECIDE TRUMP"
2570 PRINT" PLAYS FIRST."
2580 PRINT"2) IF THE COMPUTER HAS A CHANCE TO"
2590 PRINT" DECIDE TRUMP AND DOES NOT, THEN YOU"
2600 PRINT" MUST DECIDE."
2610 RETURN
2620 :
2630 LC=XC
2640 XC=0:RR=0
2650 B=ABS(4-XX)+1
2660 FORI=1TO5
2670 IFMS(I)=XXANDMC(I)=3THENXC=XC+8:GOTO2700
2680 IFMS(I)=XXTHENXC=XC+MC(I)
2690 IFMS(I)=BANDMC(I)=3THENXC=XC+7
2700 NEXT
2710 FORI=1TO5:IFMC(I)=6ANDMS(I)<>XXTHENXC=XC+3
2720 IFMC(I)=5ANDMS(I)<>XXTHENXC=XC+1
2730 NEXT
2740 IFXC<15THENXC=LC:RETURN
2750 TM=XX
2760 PRINT" I":PRINT" ORDER":TR=1:MD=0:POKE54273,34:POKE54272,75
2770 POKE54276,33:FORDL=1TO100:NEXT:POKE54276,32:FORDL=1TO1000:NEXT
2780 RR=1:XC=LC:RETURN
2790 PRINT""
2800 FORI=1TO7:PRINTB$:NEXT
2810 PRINT"[145][145][145][145][145][145] ";TP$(TM)" ARE TRUMP"
2820 IFMD=1THENPRINT" MY LEAD....":GOTO2840
2830 PRINT" YOUR LEAD...."
2840 FORDL=1TO1000:NEXT
2850 RETURN
2860 ONTRGOTO2870,3320
2870 GETG$:IFG$=""THEN 2870
2880 CC=VAL(G$)
2890 IFCC>0ANDCC<6THEN 2910
2900 GOTO2870
2910 IFPC(CC)=0THENPRINT" THAT[157][157][157][157]CARD[157][157][157]IS[157][157][157]GONE":GOTO2870
2920 PRINT"":FORI=1TO7:PRINTB$:NEXT
2930 PRINT""
2940 FORI=1TO7
2950 PRINTTAB((CC-1)*7+1)" "
2960 NEXT
2970 C$(1)=CD$(PC(CC))+" "
2980 C$(2)=ST$(PS(CC))+" "
2990 C$(3)=" "
3000 C$(4)=" "+ST$(PS(CC))
3010 C$(5)=" "+CD$(PC(CC))
3020 PRINT"":I=7:X1=PS(CC):GOSUB670
3030 CA=0:CT=0
3040 FORI=1TO5
3050 IFMS(I)=PS(CC)ANDMC(I)>CATHENCA=MC(I):CT=I
3060 NEXT
3070 IFCA=0THEN3210
3080 IFCA>PC(CC)THEN3130
3090 CA=6
3100 FORI=1TO5
3110 IFMS(I)=PS(CC)ANDMC(I)<CAANDMC(I)>0THENCA=MC(I):CT=I
3120 NEXT
3130 C$(1)=CD$(MC(CT))+" "
3140 C$(2)=ST$(MS(CT))+" "
3150 C$(3)=" "
3160 C$(4)=" "+ST$(MS(CT))
3170 C$(5)=" "+CD$(MC(CT))
3180 PRINT"":FORI=1TO7:PRINTTAB((CT-1)*7+1)" ":NEXT
3190 PRINT"":I=18:X1=MS(CT):GOSUB670
3200 GOSUB3710:GOTO620
3210 CA=9
3220 FORI=1TO5
3230 IF(MS(I)=TM)AND(MC(I)<CA)ANDMC(I)>0THENCA=MC(I):CT=I
3240 NEXT
3250 IFCA=9THEN3270
3260 GOTO3130
3270 CA=9
3280 FORI=1TO5
3290 IFMC(I)<CAANDMC(I)>0THENCA=MC(I):CT=I
3300 NEXT
3310 GOTO3130
3320 IFMD=0THEN3440
3330 CA=0
3340 FORI=1TO5
3350 IFMC(I)>CAANDMS(I)<>TMTHENCA=MC(I):CT=I
3360 NEXT
3370 IFCA=0THEN3390
3380 GOTO3500
3390 CA=0
3400 FORI=1TO5
3410 IFMC(I)>CATHENCA=MC(I):CT=I
3420 NEXT
3430 GOTO 3500
3440 CA=0
3450 FORI=1TO5
3460 IFMC(I)>CAANDMS(I)=TMTHENCA=MC(I):CT=I
3470 NEXT
3480 IFCA=0THEN3340
3490 GOTO3500
3500 GOSUB 2090
3510 GETG$:IFG$=""THEN 3510
3520 CC=VAL(G$)
3530 IFCC>0ANDCC<6THEN 3550
3540 GOTO3500
3550 IFPC(CC)=0THENPRINT" THAT[157][157][157][157]CARD[157][157][157]IS[157][157][157]GONE":GOTO3510
3560 IFPS(CC)=MS(CT)THEN3590
3570 FORI=1TO5:IFPS(I)=MS(CT)THENPRINT" NO[157][157][157][157][157]RENAGING":GOTO3510
3580 NEXT
3590 PRINT""
3600 FORI=1TO7
3610 PRINTTAB((CC-1)*7+1)" "
3620 NEXT
3630 C$(1)=CD$(PC(CC))+" "
3640 C$(2)=ST$(PS(CC))+" "
3650 C$(3)=" "
3660 C$(4)=" "+ST$(PS(CC))
3670 C$(5)=" "+CD$(PC(CC))
3680 PRINT"":I=18:X1=PS(CC):GOSUB670
3690 GOSUB3710
3700 GOTO620
3710 PRINT"":FORI=1TO7:PRINT" ":NEXT
3720 IFMS(CT)=PS(CC)THEN3770
3730 IFMS(CT)=TMTHENPRINT" MY[157][157][157]TRICK":VC=VC+1:TR=2:GOTO3790
3740 IFTR=2ANDPS(CC)<>TMTHENMS(CT)=TM:GOTO3730
3750 PRINT" YOUR[157][157][157][157]TRICK":YR=YR+1:TR=1
3760 GOTO3790
3770 IFMC(CT)>PC(CC)THENPRINT" MY[157][157][157]TRICK":TR=2:VC=VC+1:GOTO3790
3780 PRINT" YOUR[157][157][157][157]TRICK":YR=YR+1:TR=1
3790 PC(CC)=0:PS(CC)=0
3800 IFYR>0THENPOKE1662+YR*40,81
3810 IFVC>0THENPOKE1102+VC*40,81
3820 MC(CT)=0:MS(CT)=0
3830 IFVC+YR<5THEN4000
3840 FORDL=1TO500:NEXT
3850 PRINT"":FORI=1TO7:PRINT" ":NEXT
3860 IFVC>YRTHENPRINT" MY[157][157][157]POINT":MM=MM+1:P=1:IFVC=5THENMM=MM+1
3870 IFP=1ANDMD=1THENMM=MM+1:GOTO3910
3880 IFP=1THEN3910
3890 PRINT" YOUR[157][157][157][157]POINT":YY=YY+1:P=1:IFYR=5THENYY=YY+1
3900 IFP=1ANDMD=0THENYY=YY+1:GOTO3910
3910 P=0:VC=0:YR=0:J=1
3920 FORDL=1TO2000:NEXT
3930 IFMM>9THENPRINT"[147]SID WINS...";MM"TO"YY:YF=YF+1:GOTO3960
3940 IFYY>9THENPRINT"[147]"NM$" WINS...";YY"TO";MM:FY=FY+1:GOTO3960
3950 GOTO4000
3960 PRINT"SID-";YF:PRINTNM$;FY
3970 PRINT"DO YOU WISH A REMATCH"
3980 INPUTA$:IFA$="Y"THENMM=0:YY=0:GOTO4000
3990 PRINT"OK":POKE53281,15:END
4000 RETURN